@extends('layouts.admin')
@section('content')
	<div class="login_box">
		<h1>Blog</h1>
		<h2>欢迎使用博客管理平台</h2>
		<div class="form result_title" >
			@if (count($errors) > 0)
				<div class="mark">
					<ul>
						@if(is_object($errors))
							@foreach ($errors->all() as $error)
								<li>{{ $error }}</li>
							@endforeach
						@else
							<li>{{ $errors }}</li>
						@endif
					</ul>
				</div>
			@endif
			{{--<p style="color:red">用户名错误</p>--}}
			<form action="{{url('admin/login')}}" method="post">
				{{--<input type="hidden" name="_token" value="{{csrf_token()}}">--}}
				{{csrf_field()}}
				<ul>
					<li>
					<input type="text" name="username" class="text" value="{{old('username')}}"/>
						<span><i class="fa fa-user"></i></span>
					</li>
					<li>
						<input type="password" name="password" class="text" value="{{old('password')}}"/>
						<span><i class="fa fa-lock"></i></span>
					</li>
					<li>
						<input type="text" class="code" name="code" value="{{old('code')}}"/>
						<span><i class="fa fa-check-square-o"></i></span>
						{{--<img src="{{url('admin/login/code')}}" onclick="this.src='{{url('admin/login/code')}}?'+Math.random()" alt="">--}}

						<a onclick="javascript:re_captcha();">
							<img src="{{ URL('/code/captcha/1') }}" id="127ddf0de5a04167a9e427d883690ff6">
						</a>
					</li>
					<li>
						<input type="submit" value="立即登陆"/>
					</li>
				</ul>
			</form>
			<p><a href="#">返回首页</a> &copy; 2016 Powered by <a href="http://www.itxdl.cn" target="_blank">http://www.baidu.cn</a></p>
		</div>
	</div>
	<script type="text/javascript">
        function re_captcha() {
            $url = "{{ URL('/code/captcha') }}";
            $url = $url + "/" + Math.random();
            document.getElementById('127ddf0de5a04167a9e427d883690ff6').src = $url;
        }
	</script>
@endsection